/* 
 * Copyright (C) 2012 Martin Řehánek <rehan at mzk.cz>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * This is interface even thout it doesn't explicitly define methods
 */
goog.provide('kramerius.audio.TrackFactory');
goog.require('kramerius.audio.Track');
goog.require('kramerius.audio.DebugTrack');

/**
 * @constructor 
 * @param {string| null} audioProxyUrl Url of audio proxy for Tracks.
 * @param {string| null} debugTrackBaseUrl Base url for DebugTracks.
 */
kramerius.audio.TrackFactory = function (audioProxyUrl, debugTrackBaseUrl){
    this.audioProxyUrl_ = audioProxyUrl;
    this.debugTrackBaseUrl_ = debugTrackBaseUrl;
}


/**
 * @param {!string} pid Persistent identifier of the track object in Fedora repository.
 * @param {!string} title Name of the track.
 * @param {!string} length Length of the track
 * @return {kramerius.audio.Track} Instance of track.
 */
kramerius.audio.TrackFactory.prototype.createTrack = function (pid, title, length){
    return new kramerius.audio.Track(pid, title, length, this.audioProxyUrl_);
}

/**
 * @param {!string} id Unique identifier of the track.
 * @param {!string} title Name of the track.
 * @param {!string} length Length of the track
 * @param {string|null} mp3File in the web server, i.e. absolute url of mp3 file is baseUrl + mp3File
 * @param {string|null} oggFile in the web server, i.e. absolute url of ogg file is baseUrl + mp3File
 * @return {kramerius.audio.DebugTrack} Instance of track for debugging.
 */
kramerius.audio.TrackFactory.prototype.createDebugTrack = function (id, title, length, mp3File, oggFile){
    return new kramerius.audio.DebugTrack(id, title, length, this.debugTrackBaseUrl_, mp3File, oggFile);
}







